const filter = {
  state: {
    query:{
      name: null,
      type: null,
      xzjd: null,
      beginArea: null,
      endArea: null
    },
    land_type_active: 0,
    street_active: 0,
    land_area_active: 0,
  },
  mutations: {
    SET_QUERY: (state, query) => {
      state.query = query
    },
    SET_LAND_TYPE_ACTIVE: (state, payload) => {
      state.land_type_active = payload
    },
    SET_STREET_ACTIVE: (state, payload) => {
      state.street_active = payload
    },
    SET_LAND_AREA_ACTIVE: (state, payload) => {
      state.land_area_active = payload
    }
  },

  actions: {
    filterReset({ commit }, userInfo) {
      commit('SET_QUERY', {
        name: null,
        type: null,
        xzjd: null,
        beginArea: null,
        endArea: null,
        pageSize: 2000,
        pageNum: null
      });
      commit('SET_LAND_TYPE_ACTIVE',0);
      commit('SET_STREET_ACTIVE',0);
      commit('SET_LAND_AREA_ACTIVE',0);
    }
  }
}

export default filter
